<div class="comment-bom-bar">
    <div class="comment-fix-bar">
        <input type="text" class="comment-fb-link" placeholder="发表评论"/>
        <a class="comment-list-link" href="{$cmsurl}pub/article_comment_list?typeid={$typeid}&articleid={$info['articleid']}"><i class="icon"></i>{$info['commentnum']}</a>
        <span class="make-zan-btn {$favorite}" id="clickZan"><i class="icon"></i>{$info['favorite']}</span>
        <div class="collection_btn">
            {include "collect/icon"}
        </div>
    </div>
</div>
<script>
    $(function(){
        $('.comment-fb-link').click(function(){
            var url = SITEURL+'pub/article_write_comment?typeid={$typeid}&articleid='+"{$info['articleid']}";
            window.location.href = url;
        })
        var execute = true;
        $('#clickZan').on('click',function(){
            // var clickZan = new thumbsUp(this);
            // $(this).addClass('after');
            if($('#clickZan').hasClass('after')){
               layer.open({
                    content: '{__("focus_hased")}',
                    skin: 'msg',
                    time: 2
                });
                return;
            }
            var notes_id = <?=$info['articleid']?>;
            $.ajax({
                type:'POST',
                url:SITEURL+'notes/ajax_add_focus',
                dataType: 'json', 
                data:{
                    notes_id:notes_id
                },
                success: function(data){
                    if(data.status == 'success') {
                        var clickZan = new thumbsUp($('#clickZan'));
                        $('#clickZan').addClass('after');
                        var zan_num = Number($('#clickZan').text());
                        zan_num = zan_num + 1;
                        $('#clickZan').html('<i class="icon"></i>'+zan_num);
                    } 
                    else if(data.status == 'hased')
                    {
                        layer.open({
                            content: '{__("focus_hased")}',
                            skin: 'msg',
                            time: 2
                        });
                    }else{
                        layer.open({
                            content: '{__("focus_failure")}',
                            skin: 'msg',
                            time: 2
                        });
                    }
                }
            });
        })
    })
</script>